package com.coffee.controller;


import com.coffee.conmmon.BaseResult;
import com.coffee.service.ShomeService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/shome")
@CrossOrigin
public class ShomeController {
    @Autowired
    ShomeService shomeService;

    @RequestMapping(value = "/findAll",method = RequestMethod.GET)
    @ApiOperation("查询所有")
    public BaseResult findAll(){
        return shomeService.findAll();
    }

    @RequestMapping(value = "/findAllByHid",method = RequestMethod.POST)
    @ApiOperation("查询单个")
    public BaseResult findAllByHid(@RequestBody Integer hid){
        return shomeService.findAllByHid(hid);
    }
}
